package reflect;

import java.lang.reflect.Method;

public class ReflectDemo1 {
    public static void main(String[] args) {
        Class cls = String.class;
        String name = cls.getName();
        System.out.println(name);

        name = cls.getSimpleName();
        System.out.println(name);
        System.out.println("---------------------");

        Method[] methods = cls.getMethods();
        for (Method method : methods) {
            String methodName = method.getName();
            System.out.println(methodName);
        }
        System.out.println("---------------------");

        Package pack = cls.getPackage();
        System.out.println(pack.getName());
        System.out.println("---------------------");
    }
}
